package cn.com.nes.site.service.project;

import cn.com.nes.mybatis.agent.project.entity.TProject;
import cn.com.nes.site.entity.PageData;
import cn.com.nes.site.entity.bo.project.DispatchedProjectBO;
import cn.com.nes.site.entity.bo.project.ProjectImportCustomersPageBO;
import cn.com.nes.site.entity.bo.project.ProjectQueryBO;
import cn.com.nes.site.entity.bo.project.ProjectSaveBO;
import cn.com.nes.site.entity.vo.project.DelProjectImportCustomersVO;
import cn.com.nes.site.entity.vo.project.ProjectAcceptanceVO;
import cn.com.nes.site.entity.vo.project.ProjectPageVO;
import cn.com.nes.site.service.project.dto.GetTProjectByOrderId;
import cn.com.nes.site.service.project.dto.ProjectRelationshipDTO;
import cn.com.nes.site.service.project.dto.TProjectDTO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Set;

/**
 * 项目服务
 */
public interface TProjectService extends IService<TProject> {

    TProject getProjectDetail(Long projectId);


    TProjectDTO getProjectDetail(ProjectQueryBO bo) throws Exception;


    /**
     * 更新项目的负责人信息和商机信息
     * @param projectId        项目id
     * @param masterCustomerId 负责人id
     * @param opportunityUuid  商机id
     */
    void updateProjectById(Long projectId, String masterCustomerId, String opportunityUuid) throws Exception;


    /**
     * 保存项目信息
     * @param bo 保存项目信息模型
     * @return
     */
    TProject projectSave(ProjectSaveBO bo) throws Exception;


    /**
     * 查询项目分页列表
     * @param vo 项目分页查询模型
     * @return
     */
    Page<TProjectDTO> projectPage(ProjectPageVO vo) throws Exception;


    /**
     * 查询项目派单分页列表
     * @param dispatchedProjectBO 派单项目分页模型
     * @return
     */
    Page<TProjectDTO> dispatchedProjectPage(DispatchedProjectBO dispatchedProjectBO) throws Exception;


    /**
     * 查询导入用户分页列表
     * @param projectImportCustomersPageBO
     * @return
     */
    Page<ProjectRelationshipDTO> getProjectImportCustomers(
            ProjectImportCustomersPageBO projectImportCustomersPageBO) throws Exception;


    /**
     * 查询派单分页列表
     * @param dispatchedProjectBO
     * @return
     */
    @Deprecated
    PageData dispatchedOrderPageForProject(DispatchedProjectBO dispatchedProjectBO) throws Exception;


    List<GetTProjectByOrderId> getTProjectByOrderId(Long workOrderId);


    /**
     * 删除项目导入客户
     */
    Integer delProjectImportCustomers(DelProjectImportCustomersVO vo) throws Exception;


    /**
     * 根据项目uuid查询项目id
     */
    Long getProjectIdByUuid(String projectUuid) throws Exception;


    /**
     * 根据uuid查询项目详情
     */
    TProjectDTO getProjectDetail(String projectUuid) throws Exception;


    /**
     * 根据项目uuid，查询项目信息
     * @param projectUuid
     * @return
     */
    TProject getProjectByUuid(String projectUuid) throws Exception;


    /**
     * 查询项目
     * @param idOrUuid 主键ID或UUID
     * @return
     */
    TProject getProject(String idOrUuid) throws Exception;


    TProject getProjectByopportunityUuid(String opportunityUuid) throws Exception;


    /**
     * 查询项目id集合
     */
    Set<Long> getProjectIdSet(String companyId, String projectName, String projectType, String projectStatus);


    Integer projectAcceptance(ProjectAcceptanceVO vo);

}
